#include <bits/stdc++.h>

using namespace std;

const int N = 100010;
int num[N], arr1[N];

void merge_sort(int *arr, int left, int right)
{
    if (left >= right)
    {
        return;
    }
    int mid = (left + right) >> 1;
    merge_sort(arr, left, mid);
    merge_sort(arr, mid + 1, right);
    int i = left, j = mid + 1;
    int k = 0;
    while (i <= mid && j <= right)
    {
        if (arr[i] < arr[j])
        {
            arr1[k++] = arr[i++];
        }
        else 
        {
            arr1[k++] = arr[j++];
        }
    }
    while (i <= mid)
    {
        arr1[k++] = arr[i++];
    }
    while (j <= right)
    {
        arr1[k++] = arr[j++];
    }
    for (int i = left, j = 0; i <= right; ++i, ++j)
    {
        arr[i] = arr1[j];
    }
}

int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        scanf("%d", &num[i]);
    }
    merge_sort(num, 0, n - 1);
    return 0;
}
